<% implementation_names = Implementation.names(@address) %>
<% implementation_name =
      if Enum.empty?(implementation_names) do
        nil
      else
        implementation_names |> Enum.at(0)
      end
%>
<%= if @address do %>
  <%= if assigns[:show_full_hash] do %>
    <%= if name = if assigns[:ignore_implementation_name], do: primary_name(@address), else: implementation_name || primary_name(@address) do %>
      <span><%= name %> |
    <% end %>
    <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @address), "data-test": "address_hash_link", class: assigns[:class] do %>
      <%= @address %>
    <% end %>
    </span>
  <% else %>
    <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @address), "data-test": "address_hash_link", class: assigns[:class] do %>
      <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address: @address, contract: @contract, truncate: assigns[:truncate], use_custom_tooltip: @use_custom_tooltip, no_tooltip: assigns[:no_tooltip], custom_classes_tooltip: assigns[:custom_classes_tooltip], ignore_implementation_name: assigns[:ignore_implementation_name] %>
    <% end %>
  <% end %>
<% end %>
